<h3>激活商品</h3>
<%=form_tag "/products/update_active"%>
<table class="order_list">
  <thead>
    <tr>
      <th>编号</th>
      <th>名称</th>
      <th>图片</th>
      <th>上次激活</th>
      <th>激活</th>
      <th>编辑</th>
      <th>删除</th>
    </tr>
  </thead>
  <tbody>
    <% for @product in @products  %>
      <tr class="action_link">
        <td>
          <%=@product.id%>
        </td>
        <td>
          <%=@product.name + " " + @product.size.to_s + @product.unit.to_s %>
        </td>
        <td>
          <% if @product.image_url %>
            <%= image_tag url_for_file_column(@product, "image_url","thumb"),:class=>'product_img' %>
          <%  end %>
        </td>
        <td>
          <%=@product.active_date%>
        </td>
        <td>
          <%=check_box_tag("product[#{@product.id}][active]", 1)%>
        </td>
        <td>
          <%= link_to '编辑', [:edit,@product],:class=>'action_edit' %>
        </td>
        <td>
          <%= link_to '删除',[@product], :confirm => 'Are you sure?', :method => :delete,:class=>'action_delete' %>
        </td>
      </tr>
    <% end %>
  </tbody>
  <tfoot>
    <tr>

      <td colspan="6">
        <%= will_paginate @products,:prev_label => '«上一页',:next_label => '下一页»' %>
      </td>
      <td>
        <input type="submit" value="激活" />
      </td>
    </tr>
  </tfoot>
</table>
</form>